package com.eastfair.venuebooking.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.core.base.R;
import com.eastfair.venueservice.dto.ViolationRecordDTO;
import com.eastfair.venueservice.vo.ViolationRecordVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 违规记录 feign.
 *
 * @Author lyw
 * @Date 2022 /9/9 11:42
 */
@FeignClient(value = "venue-services-manage/violationRecord")
public interface ViolationRecordFeign {

    /**
     * 查询违规惩罚记录列表分页
     *
     * @param params the params
     * @return r
     */
    @ApiOperation(value = "查询违规惩罚记录列表分页")
    @PostMapping(value = "/queryViolationRecordList")
    R<Page<ViolationRecordVO>> queryViolationRecordList(@RequestBody PageParams<ViolationRecordDTO> params);

    /**
     * 查询违规惩罚记录详情
     *
     * @param violationRecordDTO the violation record dto
     * @return r
     */
    @ApiOperation(value = "查询违规惩罚记录详情")
    @PostMapping(value = "/queryViolationRecordInfo")
    R<ViolationRecordVO> getViolationRecord(@RequestBody ViolationRecordDTO violationRecordDTO);

    /**
     * 保存违规惩罚记录
     *
     * @param violationRecordDTO the violation record dto
     * @return r
     */
    @ApiOperation(value = "保存违规惩罚记录")
    @PostMapping(value = "/saveViolationRecordInfo")
    R<Boolean> saveForHome(@RequestBody ViolationRecordDTO violationRecordDTO);

    /**
     * 修改违规惩罚记录
     *
     * @param violationRecordDTO the violation record dto
     * @return r
     */
    @ApiOperation(value = "修改违规惩罚记录")
    @PostMapping(value = "/updateViolationRecordInfo")
    R<Boolean> updateViolationRecord(@RequestBody ViolationRecordDTO violationRecordDTO);

    /**
     * 更新处罚扣款.
     *
     * @param violationRecordDTO the violation record dto
     * @return the r
     */
    @PostMapping(value = "/update/publishAmount")
    R<Boolean> updatePublishAmount(@RequestBody ViolationRecordDTO violationRecordDTO);

    /**
     * 撤销处罚.
     *
     * @param id the id
     * @return the r
     */
    @GetMapping(value = "/update/cancel/{id}")
    R<Boolean> updateViolationCancel(@PathVariable("id") Long id);

    /**
     * 删除违规惩罚记录
     *
     * @param id the id
     * @return r
     */
    @ApiOperation(value = "删除违规惩罚记录")
    @GetMapping(value = "/delViolationRecordInfo/{id}")
    R<Boolean> delViolationRecord(@PathVariable(value ="id") Long id);

}
